// component_demo/trans-swiper/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    currIndex:0,
    // animateStart:true
  },

  swiperChange(e){
    const currIndex=e.detail.current
    let animateName='prev2item';

    if(currIndex>this.data.currIndex){
      animateName='next2item'
    }

    this.setData({
      currIndex,
      animateName,
      animateStart:false
    })

    setTimeout(_=>{
      this.setData({
        animateStart:true
      })
    },20010)
  }
})